feat(site-migrator)!: extract BlockTargetAdapter to decouple BurgerEditor conversion - #1007
Merged
Merged
Conversation
…itor conversion extractPages/migrate no longer hardcode BurgerEditor's classify/rewriteRefs/render/ downloadFiles pipeline. They now delegate to a required `adapter` option (BlockTargetAdapter<TBlocks>), with burgerEditorAdapter providing the existing BurgerEditor behavior as the built-in implementation. Archive access, anatomist wiring, id assignment, frontmatter generation, and same-origin ref rewriting stay as adapter-agnostic shared logic, so a future non-BurgerEditor target can reuse them without depending on @burger-editor/core. BREAKING CHANGE: `adapter` is now a required option on `extractPages` and `migrate`. Existing callers (including `dz-migrate`) must pass `burgerEditorAdapter` explicitly. No migration guide is provided (package is still 5.x-alpha and unused by any consumer).
YusukeHirao
requested review from
arktds,
dz-furukawa,
teppei-d and
yusasa16
as code owners
August 11, 2026 03:23
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extractPages/migrateinto a pluggableBlockTargetAdapter<TBlocks>interface (src/adapter.ts), so a future non-BurgerEditor block CMS target can reuse the shared nitpicker-archive/anatomist/id-assignment/frontmatter/write pipeline without depending on@burger-editor/core.burgerEditorAdapter(src/page-extractor/burger-editor-adapter.ts) as the built-in default implementation, composed from the existinglayoutToBlockData/rewriteBlockRefs/renderBlocks/downloadBlockFilesfunctions (unchanged).adapteris now a required option onextractPagesandmigrate.dz-migrateCLI now passesburgerEditorAdapterexplicitly.isMainConsistent's anatomist/extractMainContentconsistency check stays in the adapter-agnostic shared layer (extractPages), since it doesn't depend on the target block shape.RawFallbackhelper inextract-pages.ts.Breaking change
adapteris a required parameter onextractPages/migrate. No migration guide is provided —site-migratoris still5.x-alphaand not yet consumed by any other package/service.Test plan
yarn build(type-checkssite-migrator)yarn lintyarn test(357 tests, including 2 new tests inextract-pages.spec.tsand 1 new test inmigrate.spec.tsusing a non-BurgerEditor fake adapter to proveextractPages/migrategenuinely forwardoptions.adapterinstead of hardcodingburgerEditorAdapter)